from typing import List
import numpy as np


class Solution:
    def checkStraightLine(self, coordinates: List[List[int]]) -> bool:
        x1, y1 = coordinates[0]
        x2, y2 = coordinates[1]
        A = np.array([[x1, 1], [x2, 1]])
        B = np.array([y1, y2])
        a, b = np.linalg.solve(A, B)
        for i in range(2, len(coordinates)):
            x, y = coordinates[i]
            if x * a + b != y:
                return False
        return True


if __name__ == "__main__":
    Solution().checkStraightLine([[0, 0], [0, 1], [0, -1]])

